<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>平台权益</title>
    <link rel="stylesheet" type="text/css" href="../../../css/aui/aui.css" />
    <style>
        #particulars .aui-list {
            background-image: none;
        }

        #particulars .aui-list .aui-list-item {
            padding-left: 0;
            margin: .5rem .75rem 0;
        }

        #particulars .aui-list .aui-list-item-inner {
            align-items: flex-end;
            -webkit-align-items: flex-end;
            padding-right: 0.3rem;
        }

        #particulars .aui-list .aui-list-item-right {
            max-width: 100%;
            font-size: 0.75rem;
        }

        #particulars .aui-list.aui-list-in .aui-list-item {
            background-position: 0 bottom;
        }
    </style>
</head>

<body>
    <div id="app">

        <div class="aui-content" id="particulars">
            <ul class="aui-list aui-list-in">
                <li class="aui-list-item" @click="openWin('instructions', {id: v.news_id, title: v.title})" v-for="v in list">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">{{v.title}}</div>
                        <div class="aui-list-item-right">{{v.create_time}}</div>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</body>
<script src="../../../script/api.js" charset="utf-8"></script>
<script src="../../../script/common/jquery-3.3.1.min.js" charset="utf-8"></script>
<script src="../../../script/common/common.js" charset="utf-8"></script>
<script src="../../../script/common/config.js" charset="utf-8"></script>
<script src="../../../script/common/vue.min.js" charset="utf-8"></script>
<script>
    apiready = function() {
        api.parseTapmode();
        vm.init();
    }

    var vm = new Vue({
        el: "#app",
        data: {
            list: [],
            pages: 1
        },
        methods: {
            init() {
                this.page();
                this.getListData();
            },
            getListData() {
                var self = this;
                _ajax(Config.api.NewsQuanyi, {
                    pages: self.pages
                }, function(res) {
                    if (res.code === 200) {
                        if (res.data.length === 0) {
                            $toast('数据已加载完毕');
                            self.pages = -1;
                        } else {
                            self.list = self.list.concat(res.data);
                        }
                    }
                })
            },
            page() {
                // 下拉刷新
                var self = this;
                push_down(function() {
                    //下拉刷新恢复
                    push_down_over();

                    self.pages = 1;
                    self.list = [];
                    self.getListData();
                });

                //上拉加载
                push_up(function() {
                    if (self.pages === -1) {
                        $toast('数据已加载完毕');
                    } else {
                        ++self.pages;
                        self.getListData();
                    }
                });
            },
            openWin(name, param) {
                var winInfo = {
                    instructions: {
                        name: 'platform_rights_win',
                        url: './platform_rights_win.html',
                        param: param
                    },
                };
                if (name) {
                    open_w(winInfo[name].name, winInfo[name].url, winInfo[name].param);
                } else {
                    $toast("正在开发中...");
                }
            }
        }
    });
</script>

</html>
